package org.aiesec.fortaleza.xmatch.controller.action;

import org.aiesec.fortaleza.xmatch.controller.annotation.ServiceIn;
import org.aiesec.fortaleza.xmatch.model.entity.Membro;
import org.aiesec.fortaleza.xmatch.model.util.Criteria;
import org.aiesec.fortaleza.xmatch.model.util.Restrictions;
import org.jboss.seam.annotations.Name;

@ServiceIn(persistenceClass = Membro.class)
@Name("membroControllerAction")
public class MembroControllerAction extends BaseControllerAction<Membro> {

	@Override
	protected Criteria getCriteria() {
		Criteria criteria = Criteria.getInstance("Membro.queryPesquisa",
				Membro.class);
		criteria
				.addAnd(
						Restrictions.ilike("m.nome", true, getEntity()
								.getNome(), true)).addAnd(
						Restrictions.ilike("m.posicao", true, getEntity()
								.getPosicao(), true));
		return criteria;
	}

	@Override
	protected void reset() {

	}

}
